package system类;

import java.util.Arrays;

public class demo {
    public static void main(String[] args) {
        demo01();
//        demo02();
        demo03();
    }

    private static void demo03() {
        int[] arr1={1,2,3,4,5};
        int[] arr2={6,7,8,9,10};
        System.out.println("原数组:"+ Arrays.toString(arr1));
        System.arraycopy(arr1,0,arr2,0,3);
        System.out.println("复制后的数组:"+Arrays.toString(arr2));
    }

    private static void demo01() {
        long start=System.currentTimeMillis();
        for (int i = 0; i < 10111; i++) {
            for (int z = 0; z < 10100; z++) {
                System.out.print(i+"--"+"z");
            }
        }
        long end=System.currentTimeMillis();
        System.out.println("程序耗时:"+(end-start)+"毫秒");
    }
    private static void demo02() {
        long start=System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
            for (int z = 0; z < 100; z++) {
                System.out.print(i+"--"+"z");
            }
        }
        long end=System.currentTimeMillis();
        System.out.println("程序耗时:"+(end-start)+"毫秒");
    }
}
